Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented Dec 15, 2022

Closes: #8423

Description

When opening an order universal link from a store that is already chosen and visible in the app, it navigates to the orders tab but doesn't open the order details. When it has to switch sites, i.e the link is pointing to an order of a user's site that is not selected in the app, it works correctly.
The reason behind this is that we were returning false on the switchToStore completion callback because it actually didn't switch sites, as the site was already there. Once we got that, we took it as if the app failed to switch to the order's site in navigateToOrderDetails, thus not showing the order's details.
To fix it, I rename the switchToStore function in MainTabBarController to showStore, to make it more meaningful -we want to show the site, we don't care if we had to switch sites or it was present already- and return true if the the site was already shown.

Testing instructions

  1. Create a link with the format https://www.woocommerce.com/mobile/orders/details?blog_id=blog_id&order_id=order_id where blog_id = your site id that is selected in the app and order_id = an order of that site. Add that link to your email or notes app as shown in the video.
  2. Tap on that link
    Result: The app is opened and navigates to the Orders tab but the order details screen is not shown
    Expected Result: It should show the Order Details

Screenshots

Buggy behavior

RPReplay_Final1671124934.MP4

Fixed behavior

RPReplay_Final1671124853.MP4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@toupper toupper added type: bug A confirmed bug. feature: deep links Related to the universal and deep links labels Dec 15, 2022
@toupper toupper added this to the 11.8 milestone Dec 15, 2022
@toupper toupper requested a review from iamgabrielma December 15, 2022 17:47
@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8425-83bb383 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@iamgabrielma iamgabrielma self-assigned this Dec 16, 2022
Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚢

As a curiosity, something unexpected when testing the behaviour is that I mistakenly tapped cancel when the prompt Open with Woo appeared.

From that moment the system saved this preference and every time I tried to tap the deep link moving forward I was redirected to the web browser no matter what. I resolved this by clearing the simulator preferences at Simulator > Erase all content and settings, but I'm not entirely sure how would this work in a real device without clearing preferences as well, which most likely users wouldn't do.

I'm not sure if we can do something about it, just bringing it up :D

@toupper
Copy link
Contributor Author

toupper commented Dec 16, 2022

Thanks for your review @iamgabrielma!

As a curiosity, something unexpected when testing the behavior is that I mistakenly tapped cancel when the prompt Open with Woo appeared.

Yeah, that's the expected behavior. Unfortunately, after clicking on Cancel the system opens the links in Safari. We should be able to open the link back in the app by tapping on the app banner as explained here.

@toupper toupper merged commit 373de78 into trunk Dec 16, 2022
@toupper toupper deleted the issue/8423-order-details-link-bug branch December 16, 2022 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: deep links Related to the universal and deep links type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Universal Links] Link does not open the order if the link store is already selected in the app

4 participants